home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / pyshared / pycountry-0.12.1.egg-info / PKG-INFO < prev    next >
Encoding:
Text File  |  2010-06-24  |  7.3 KB  |  247 lines

  1. Metadata-Version: 1.0
  2. Name: pycountry
  3. Version: 0.12.1
  4. Summary: ISO country, subdivision, language, currency and script definitions and their translations
  5. Home-page: UNKNOWN
  6. Author: Christian Theune
  7. Author-email: ct@gocept.com
  8. License: LGPL 2.1
  9. Description: =========
  10.         pycountry
  11.         =========
  12.         
  13.         pycountry provides the ISO databases for the standards:
  14.         
  15.         639
  16.           Languages
  17.         
  18.         3166
  19.           Countries
  20.         
  21.         3166-2
  22.           Subdivisions of countries
  23.         
  24.         4217
  25.           Currencies
  26.         
  27.         15924
  28.           Scripts
  29.         
  30.         The package includes a copy from Debian's `pkg-isocodes` and makes the data
  31.         accessible through a Python API.
  32.         
  33.         Translation files for the various strings are included as well.
  34.         
  35.         
  36.         Countries (ISO 3166)
  37.         ====================
  38.         
  39.         Countries are accessible through a database object that is already configured
  40.         upon import of pycountry and works as an iterable:
  41.         
  42.           >>> import pycountry
  43.           >>> len(pycountry.countries)
  44.           246
  45.           >>> list(pycountry.countries)[0]
  46.           <pycountry.db.Country object at 0x...>
  47.         
  48.         Specific countries can be looked up by their various codes and provide the
  49.         information included in the standard as attributes:
  50.         
  51.           >>> germany = pycountry.countries.get(alpha2='DE')
  52.           >>> germany
  53.           <pycountry.db.Country object at 0x...>
  54.           >>> germany.alpha2
  55.           'DE'
  56.           >>> germany.alpha3
  57.           'DEU'
  58.           >>> germany.numeric
  59.           '276'
  60.           >>> germany.name
  61.           'Germany'
  62.           >>> germany.official_name
  63.           'Federal Republic of Germany'
  64.         
  65.         Note that historic countries, defined by the ISO 3166-3 sub-standard are not
  66.         included in this list.
  67.         
  68.         Country subdivisions (ISO 3166-2)
  69.         =================================
  70.         
  71.         The country subdivisions are a little more complex than the countries itself
  72.         because they provide a nested and typed structure.
  73.         
  74.         All subdivisons can be accessed directly:
  75.         
  76.           >>> len(pycountry.subdivisions)
  77.           4548
  78.           >>> list(pycountry.subdivisions)[0]
  79.           <pycountry.db.Subdivision object at 0x...>
  80.         
  81.         Subdivisions can be accessed using their unique code and provide at least
  82.         their code, name and type:
  83.         
  84.           >>> de_st= pycountry.subdivisions.get(code='DE-ST')
  85.           >>> de_st.code
  86.           'DE-ST'
  87.           >>> de_st.name
  88.           'Sachsen-Anhalt'
  89.           >>> de_st.type
  90.           'State'
  91.           >>> de_st.country
  92.           <pycountry.db.Country object at 0x...>
  93.         
  94.         Some subdivisions specify another subdivision as a parent:
  95.         
  96.           >>> al_br = pycountry.subdivisions.get(code='AL-BU')
  97.           >>> al_br.code
  98.           'AL-BU'
  99.           >>> al_br.name
  100.           u'Bulqiz\xeb'
  101.           >>> al_br.type
  102.           'District'
  103.           >>> al_br.parent_code
  104.           'AL-09'
  105.           >>> al_br.parent
  106.           <pycountry.db.Subdivision object at 0x...>
  107.           >>> al_br.parent.name
  108.           u'Dib\xebr'
  109.         
  110.         The divisions of a single country can be queried using the country_code index:
  111.         
  112.           >>> len(pycountry.subdivisions.get(country_code='DE'))
  113.           16
  114.         
  115.           >>> len(pycountry.subdivisions.get(country_code='US'))
  116.           57
  117.         
  118.         
  119.         Scripts (ISO 15924)
  120.         ===================
  121.         
  122.         Scripts are available from a database similar to the countries:
  123.         
  124.           >>> len(pycountry.scripts)
  125.           146
  126.           >>> list(pycountry.scripts)[0]
  127.           <pycountry.db.Script object at 0x...>
  128.         
  129.           >>> latin = pycountry.scripts.get(name='Latin')
  130.           >>> latin
  131.           <pycountry.db.Script object at 0x...>
  132.           >>> latin.alpha4
  133.           'Latn'
  134.           >>> latin.name
  135.           'Latin'
  136.           >>> latin.numeric
  137.           '215'
  138.         
  139.         
  140.         Currencies (ISO 4217)
  141.         =====================
  142.         
  143.         The currencies database is, again, similar to the ones before:
  144.         
  145.           >>> len(pycountry.currencies)
  146.           182
  147.           >>> list(pycountry.currencies)[0]
  148.           <pycountry.db.Currency object at 0x...>
  149.         
  150.           >>> argentine_peso = pycountry.currencies.get(letter='ARS')
  151.           >>> argentine_peso
  152.           <pycountry.db.Currency object at 0x...>
  153.           >>> argentine_peso.letter
  154.           'ARS'
  155.           >>> argentine_peso.name
  156.           'Argentine Peso'
  157.           >>> argentine_peso.numeric
  158.           '032'
  159.         
  160.         
  161.         Languages (ISO 639)
  162.         ===================
  163.         
  164.         The languages database is similar too:
  165.         
  166.           >>> len(pycountry.languages)
  167.           486
  168.           >>> list(pycountry.languages)[0]
  169.           <pycountry.db.Language object at 0x...>
  170.         
  171.           >>> aragonese = pycountry.languages.get(alpha2='an')
  172.           >>> aragonese.alpha2
  173.           'an'
  174.           >>> aragonese.bibliographic
  175.           'arg'
  176.           >>> aragonese.terminology
  177.           'arg'
  178.           >>> aragonese.name
  179.           'Aragonese'
  180.         
  181.         Locales
  182.         =======
  183.         
  184.         Locales are available in the `pycountry.LOCALES_DIR` subdirectory of this
  185.         package. The translation domains are called `isoXXX` according to the standard
  186.         they provide translations for. The directory is structured in a way compatible
  187.         to Python's gettext module.
  188.         
  189.         Here is an example translating language names:
  190.         
  191.           >>> import gettext
  192.           >>> german = gettext.translation('iso_3166', pycountry.LOCALES_DIR,
  193.           ...                              languages=['de'])
  194.           >>> german.install()
  195.           >>> _('Germany')
  196.           'Deutschland'
  197.         
  198.         Changes
  199.         =======
  200.         
  201.         0.12.1 (2010-04-21)
  202.         -------------------
  203.         
  204.         - Remedy brown-bag release 0.12 which was missing all data files due to a bad
  205.           interaction between the build system for the data and zest.releaeser's
  206.           full-release script.
  207.         
  208.         
  209.         0.12 (2010-04-20)
  210.         -----------------
  211.         
  212.         - Follow Debian repository to git.
  213.         
  214.         - Upgrade data to revision 770fa9cd603f90f9fb982b32fe6f45d253f1d33e as
  215.           requested by #5488 and others.
  216.         
  217.         - Reflect subdivision changes with how they reference their parents in the XML
  218.           (they used to use space as a separator but now use a hyphen).
  219.         
  220.         - Refactor index building structures a bit.
  221.         
  222.         - Remove superfluous 'code' index from subdivision database. (Together with
  223.           the data upgrade this also gets rid of all the annoying warnings as
  224.           described in #6667).
  225.         
  226.         - Some light PEP 8 improvements.
  227.         
  228.         0.11 (2009-03-03)
  229.         -----------------
  230.         
  231.         - Updated Debian repository to r1752.
  232.         
  233.         
  234.         0.10 (2008-06-26)
  235.         -----------------
  236.         
  237.         - Added support for country subdivisions (ISO 3166-2). 
  238.         
  239.         
  240.         0.9
  241.         ---
  242.         
  243.         - Initial release
  244.         
  245. Keywords: country subdivision language currency iso 3166 639 4217 15924 3166-2
  246. Platform: UNKNOWN
  247.